import request from '../utils/request'
// 评论--获取评论列表接口
export const getCommentListAPI = ({ art_id, offset = null, limit = 10 }) => {
  return request({
    url: '/v1_0/comments',
    params: {
      type: 'a',
      source: art_id,
      offset: offset,
      limit: limit
    }
  })
}
// 评论点赞接口
export const commentLikingAPI = ({ com_id }) => {
  return request({
    url: '/v1_0/comment/likings',
    method: 'POST',
    data: {
      target: com_id
    }
  })
}
// 评论取消点赞接口
export const commentDisLikingAPI = ({ id }) => {
  return request({
    url: `/v1_0/comment/likings/${id}`,
    method: 'DELETE'
  })
}
// 发布评论接口
export const pubCommentAPI = ({ art_id, content }) => {
  return request({
    url: '/v1_0/comments',
    method: 'POST',
    data: {
      target: art_id,
      content: content
    }
  })
}
